<template>
  <div class="app-container" ref="appcontainer">
    <el-table
      v-loading="loading"
      :height="tableHeight"
      :data="list"
    >
      <el-table-column label="id" align="center" prop="id" />
      <el-table-column label="头像" align="center" prop="headImg" >
        <template slot-scope="scope">
            <img :src="scope.row.headImg" class="feadimg">
        </template>
      </el-table-column>
      <el-table-column label="员工名称" align="center" prop="userName" />
      <el-table-column label="手机号" align="center" prop="phone" />
      <!-- <el-table-column
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
      >
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['technician:technician:edit']"
            >查看</el-button
          >
          <el-button
            size="mini"
            type="text"
            @click="handleToTechnicianOpus(scope.row)"
            v-hasPermi="['store:store:edit']"
            >技师作品</el-button
          >
        </template>
      </el-table-column> -->
    </el-table>

    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>
  
<script>
import { getList } from '@/api/store/staff'
import "@riophae/vue-treeselect/dist/vue-treeselect.css";

export default {
  name: "StaffList",
  data() {
    return {
      tableHeight: 0,
      // 遮罩层
      loading: true,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        storeId: null,
      },
      list: []
    };
  },
  created() {
    this.calHeight();
    this.queryParams.storeId = this.$route.query.id
    this.getList()
  },
  watch: {},
  methods: {
    calHeight() {
      this.$nextTick(() => {
        const rect = this.$refs.appcontainer.getBoundingClientRect();
        this.tableHeight = rect.height - 120;
      });
    },
    /** 查询技师信息列表 */
    getList() {
      this.loading = true;
      getList(this.queryParams).then((response) => {
        this.list = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
  },
};
</script>
<style scoped>
.feadimg {
    width: 50px;
    height: 50px;
}
</style>
  